package com.xiaopeng.common.page;

import io.swagger.v3.oas.annotations.media.Schema;

/**
 * 分页查询请求对象
 */
public abstract class BasePageRequest {

    @Schema(description = "当前页码")
    protected Integer pageNum;

    @Schema(description = "每页行数")
    protected Integer pageSize;

    @Schema(description = "是否进行count查询")
    protected Boolean isCount = true;

    public Integer getPageNum() {
        return pageNum;
    }

    public <T extends BasePageRequest> T setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
        return (T) this;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public <T extends BasePageRequest> T setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
        return (T) this;
    }

    public Boolean getIsCount() {
        return isCount;
    }

    public <T extends BasePageRequest> T setIsCount(Boolean isCount) {
        this.isCount = isCount;
        return (T) this;
    }
}
